
#include <stdio.h>
#include <stdlib.h>
/* 
 * File:   messages.h
 * Author: otaviokz
 *
 * Created on June 30, 2011, 3:04 PM
 */

#define PHILOSOFERSNUMBER 5
#define VOP 0
#define POP 1
#define REQV 2
#define REQP 3
#define ACK 5

#ifndef _MESSAGES_H
#define	_MESSAGES_H

#ifdef	__cplusplus
extern "C" {
#endif

typedef struct mq_node
{
    int id;
    int kind;
    int lc;
    int ack;
    struct mq_node *next;
} node ;

struct mq_node *mqueue;

struct mq_node *create_node(int id, int kind, int lc);
void insertNode(struct mq_node *newNode);
void ackNode(int id, int lc);
void printList();

//TODO Inserir na lista ordenadamente, adicionar acks na lista



#ifdef	__cplusplus
}
#endif

#endif	/* _MESSAGES_H */

